<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html>
<head>
<title>Class: tinymce.util.Dispatcher</title>
<meta name="generator" content="MoxieDoc" />

<link rel="stylesheet" type="text/css" href="css/reset.css" />
<link rel="stylesheet" type="text/css" href="css/grids.css" />
<link rel="stylesheet" type="text/css" href="css/general.css" />

<script type="text/javascript" src="http://www.google.com/jsapi"></script>
<script type="text/javascript">
	google.load("jquery", "1.3");
</script>
<script type="text/javascript" src="js/jquery.treeview.min.js"></script>
<script type="text/javascript" src="js/general.js"></script>
</head>
<body>
<div class="classDetailsContent">
<h1>tinymce.util.Dispatcher</h1>
<table class="classDetails">
<tr>
<td class="first">Namespace</td>
<td class="last">tinymce.util</td>
</tr>
<tr>
<td class="first">Class</td>
<td class="last">Dispatcher</td>
</tr>
</table>
<div class="classDescription">This class is used to dispatch event to observers/listeners.
All internal events inside TinyMCE uses this class.
</div>
<div class="summaryLists">
<h2>Public Methods</h2>
<table class="Methods summary">
<thead>
<tr>
<th>Method</th>
<th>Defined By</th>
</tr>
</thead>
<tbody>
<tr>
<td class="first">
<div>
<a class="memberName" href="class_tinymce.util.Dispatcher.html#Dispatcher">Dispatcher</a>(s:Object)</div>
<div class="summary">Constructs a new event dispatcher object.</div>
</td>
<td class="last">Dispatcher</td>
</tr>
<tr class="even">
<td class="first">
<div>
<a class="memberName" href="class_tinymce.util.Dispatcher.html#add">add</a>(cb:function, s:Object):function</div>
<div class="summary">Add an observer function to be executed when a dispatch call is done.</div>
</td>
<td class="last">Dispatcher</td>
</tr>
<tr>
<td class="first">
<div>
<a class="memberName" href="class_tinymce.util.Dispatcher.html#addToTop">addToTop</a>(cb:function, s:Object):function</div>
<div class="summary">Add an observer function to be executed to the top of the list of observers.</div>
</td>
<td class="last">Dispatcher</td>
</tr>
<tr class="even">
<td class="first">
<div>
<a class="memberName" href="class_tinymce.util.Dispatcher.html#dispatch">dispatch</a>(..:Object):Object</div>
<div class="summary">Dispatches an event to all observers/listeners.</div>
</td>
<td class="last">Dispatcher</td>
</tr>
<tr>
<td class="first">
<div>
<a class="memberName" href="class_tinymce.util.Dispatcher.html#remove">remove</a>(cb:function):function</div>
<div class="summary">Removes an observer function.</div>
</td>
<td class="last">Dispatcher</td>
</tr>
</tbody>
</table>
</div>
<div class="detailsList">
<div class="details">
<h2>Method details</h2>
<div class="memberDetails" id="Dispatcher">
<h3>Dispatcher<span class="memberType">constructor</span>
</h3>
<code class="syntax">public 
						function Dispatcher(s:Object)</code>
<div class="memberDescription">Constructs a new event dispatcher object.
</div>
<h4>Parameters</h4>
<table class="params">
<tr>
<td class="first">s:Object</td>
<td class="last">Optional default execution scope for all observer functions.</td>
</tr>
</table>
</div>
<div class="memberDetails" id="add">
<h3>add<span class="memberType">method</span>
</h3>
<code class="syntax">public 
						function add(cb:function, s:Object):function</code>
<div class="memberDescription">Add an observer function to be executed when a dispatch call is done.
</div>
<h4>Parameters</h4>
<table class="params">
<tr>
<td class="first">cb:function</td>
<td class="last">Callback function to execute when a dispatch event occurs.</td>
</tr>
<tr>
<td class="first">s:Object</td>
<td class="last">Optional execution scope, defaults to the one specified in the class constructor.</td>
</tr>
</table>
<h4>Returns</h4>
<div class="returns">function - Returns the same function as the one passed on.</div>
</div>
<div class="memberDetails" id="addToTop">
<h3>addToTop<span class="memberType">method</span>
</h3>
<code class="syntax">public 
						function addToTop(cb:function, s:Object):function</code>
<div class="memberDescription">Add an observer function to be executed to the top of the list of observers.
</div>
<h4>Parameters</h4>
<table class="params">
<tr>
<td class="first">cb:function</td>
<td class="last">Callback function to execute when a dispatch event occurs.</td>
</tr>
<tr>
<td class="first">s:Object</td>
<td class="last">Optional execution scope, defaults to the one specified in the class constructor.</td>
</tr>
</table>
<h4>Returns</h4>
<div class="returns">function - Returns the same function as the one passed on.</div>
</div>
<div class="memberDetails" id="dispatch">
<h3>dispatch<span class="memberType">method</span>
</h3>
<code class="syntax">public 
						function dispatch(..:Object):Object</code>
<div class="memberDescription">Dispatches an event to all observers/listeners.
</div>
<h4>Parameters</h4>
<table class="params">
<tr>
<td class="first">..:Object</td>
<td class="last">Any number of arguments to dispatch.</td>
</tr>
</table>
<h4>Returns</h4>
<div class="returns">Object - Last observer functions return value.</div>
</div>
<div class="memberDetails last" id="remove">
<h3>remove<span class="memberType">method</span>
</h3>
<code class="syntax">public 
						function remove(cb:function):function</code>
<div class="memberDescription">Removes an observer function.
</div>
<h4>Parameters</h4>
<table class="params">
<tr>
<td class="first">cb:function</td>
<td class="last">Observer function to remove.</td>
</tr>
</table>
<h4>Returns</h4>
<div class="returns">function - The same function that got passed in or null if it wasn't found.</div>
</div>
</div>
</div>
</div>
</body>
</html>
